<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改物流商')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-transUnit-edit" th:object="${transUnit}">
            <input name="id" th:field="*{id}" type="hidden" id="id">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">物流商代码：</label>
                <div class="col-sm-8">
                    <input name="transId" th:field="*{transId}" class="form-control" type="text" required readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">物流商名称：</label>
                <div class="col-sm-8">
                    <input name="transName" th:field="*{transName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">物流商编码：</label>
                <div class="col-sm-8">
                    <input name="transCode" th:field="*{transCode}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">单价：</label>
                <div class="col-sm-8">
                    <input name="unitPrice" th:field="*{unitPrice}" class="form-control" type="number" min="0">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">物流商联系方式：</label>
                <div class="col-sm-8">
                    <input name="transTele" th:field="*{transTele}" class="form-control" type="text">
                </div>
            </div>

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "bus/transUnit";
        $("#form-transUnit-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            var id = $("#id").val();
            var url = "";
            if (id == "") {
                url = prefix + "/add";
            } else {
                url = prefix + "/edit";
            }
            if ($.validate.form()) {
                $.operate.save(url, $('#form-transUnit-edit').serialize());
            }
        }
    </script>
</body>
</html>